<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<style>
</style>
<script type="text/javascript">
   $(function () {
       var url='${path}/example/sendDocument/edit';
       $('#sendDocumentEditForm').form({
           url : url,
           onSubmit : function() {
               progressLoad();
               var isValid = $(this).form('validate');
               if (!isValid) {
                   progressClose();
               }
               return isValid;
           },
           success : function(result) {
               progressClose();
               result = $.parseJSON(result);
               if (result.success) {
                   showMsg(result.msg);
                   parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                   parent.$.modalDialog.handler.dialog('close');
               } else {
                   var form = $('#sendDocumentEditForm');
                   parent.$.messager.alert('错误', result.msg, 'error');
               }
           }
       });
       $('#sendDocumentEditForm [name=docType]').val('${sendDocument.docType}');
       var val='${sendDocument.emergencyLevel}';
	   	$.each($('#sendDocumentEditForm [name=emergencyLevel]'),function(index,item){
	   		if($(this).val()==val){
	   			$(this).attr('checked',true);
	   		}
	   	})
       var val1='${sendDocument.emergencyLevel}';
	   	$.each($('#sendDocumentEditForm [name=emergencyLevel]'),function(index,item){
	   		if($(this).val()==val1){
	   			$(this).attr('checked',true);
	   		}
	   	})
   })


</script>
<div class="easyui-layout" data-options="fit:true,border:false" >
    <div data-options="region:'center',border:false" style="overflow-x:hidden;overflow-y: auto;padding: 3px;" >
        <form id="sendDocumentEditForm" method="post">
        <input type="hidden" name="id" value="${sendDocument.id }" />
         <input name='userName'   type='hidden' placeholder='请输入申请人' class='easyui-text-2  span2' value="${sendDocument.userName}" disabled="disabled">
         <input type="hidden" name="userid" value='${sendDocument.userid}'/>
            <table class="grid">
 				<tr>
                      <td style="text-align:right">公文类型</td>
                      <td>
                        <select name="docType" class="easyui-text-2">
                        	<option value="决议">决议</option>
                        	<option value="决定">决定</option>
                        	<option value="函">函</option>
                        </select>
                     </td>
                     <td>发文字号</td>
                  	<td>
                  	<input type="text" name="docNo" class="easyui-text-2" value="${sendDocument.docNo}"/>
                  	</td>
                  </tr>
                  <tr>
                   <td style="text-align:right">
                     	紧急程度
                     </td>
                     <td>
                     <input type="radio" name="emergencyLevel" value="普通"/>普通
                     <input type="radio" name="emergencyLevel" value="紧急"/>紧急
                     <input type="radio" name="emergencyLevel" value="特急"/>特急
                     </td>
                   <td style="text-align:right">
                     	 密级
                     </td>
                     <td>
                     <input type="radio" name="denseGrade" value="绝密"/>绝密
                     <input type="radio" name="denseGrade" value="机密"/>机密
                     <input type="radio" name="denseGrade" value="秘密"/>秘密
                     <input type="radio" name="denseGrade" value="普通"/>普通
                     </td>
                  </tr>
                   <tr>
                     <td style="text-align:right">标题</td>
                      <td colspan="3">
                        <input name='title' type='text' placeholder='请输入标题' class='easyui-text-2  span2' style="width:90%" value="${sendDocument.title}">
                     </td>
                  </tr>
                   <tr>
                     <td style="text-align:right">主题</td>
                      <td colspan="3">
                        <input name='topic'   type='text' placeholder='请输入标题' class='easyui-text-2  span2' style="width:90%" value="${sendDocument.topic}">
                     </td>
                  </tr>
                  
                  <tr>
                     <td style="text-align:right">正文</td>
                      <td colspan="3">
                      	<input name='contentText' id="contentText_edit"  type="hidden"/>
                      	<div id="contentText_edit_disp"></div>
                      	<a onclick="attachUpload('contentText_edit','contentText_edit_disp')" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'fi-plus icon-green'">上传文件</a>      	
                     </td>
                     </tr>
                    <tr>
                       <td style="text-align:right">附件</td>
                     <td colspan="3">
                     <input name='attachId' id="attachId_edit"  type="hidden"/>
                      	<div id="attachId_edit_disp"></div>
                      	<a onclick="attachUpload('attachId_edit','attachId_edit_disp')" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'fi-plus icon-green'">上传文件</a>      	
                     </td>
                  </tr> 
                  <tr>
                  	<td>主办部门</td>
                  	<td>
                  	<input type="hidden" id="mainBoardUnit_eidt" name="mainBoardUnit" value="${sendDocument.mainBoardUnit}"/>
                  	<input type="text" class="easyui-text-2" id="mainBoardUnit_edit_disp" onfocus="selectOrg(false,'mainBoardUnit_edit','mainBoardUnit_edit_disp')" value="${sendDocument.mainBoardUnitName}"/>
                  	</td>
                  	<td>份数</td>
                  	<td>
                  		<input type="number" name="num" class="easyui-text-2" value="${sendDocument.num}"/>
                  	</td>
                  </tr>
                   <tr>
                     <td style="text-align:right">主送单位</td>
                      <td colspan="3">
                        <input name='mainUnit'   type='text' placeholder='请输入' class='easyui-text-2  span2' style="width:90%" value="${sendDocument.mainUnit}">
                     </td>
                  </tr>
                   <tr>
                     <td style="text-align:right">抄送单位</td>
                      <td colspan="3">
                        <input name='ccUnit'   type='text' placeholder='请输入' class='easyui-text-2  span2' style="width:90%" value="${sendDocument.ccUnit}">
                     </td>
                  </tr>
            </table>
        </form>
    </div>
</div>